#include	"SoundException.h"
#include	<fmod_errors.h>

SoundException::SoundException(const std::string & message)
	:	std::exception(message.c_str())
	,	m_code(FMOD_OK)
{
}

SoundException::SoundException(FMOD_RESULT code)
	:	std::exception()
	,	m_code(code)
{
}

FMOD_RESULT SoundException::code() const
{
	return m_code;
}

const char * SoundException::what() const
{
	if(m_code != FMOD_OK)
	{
		return FMOD_ErrorString(m_code);
	}
	else
	{
		return std::exception::what();
	}
}

